package com.wn.controller;

import com.wn.bean.Building;
import com.wn.bean.R;
import com.wn.service.BuildingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.stream.Collectors;

@RestController
@RequestMapping("/building")
public class BuildingController {

    @Autowired
    private BuildingService buildingService;


    @GetMapping("/all")
    public R queryBuildAll() {

        List<Building> list = buildingService.list();
        R ok = R.OK();
        ok.setData(list);
        return ok;

    }


}
